'use strict';

let Koa = require("koa");
let bodyparser  = require("koa-bodyparser");
let server = require("koa-static");

let app = new Koa();
let index = require("./controllers");
let templating = require("./templating");
let session = require("./session");
let modle = require("./modles");

app.use(session(app));
app.use(bodyparser());
app.use(templating);
app.use(server(__dirname));
app.use(index());


(async ()=>{
    console.log('正在初始化数据表。。。');
    // await modle.sync();
})();


let port = 3070;

app.listen(port,()=>{
    console.log(`http://localhost:${port}`);
})